(ns com.jeff.tracer.vect-test)

(use 'com.jeff.tracer.vect)

(def test-dot-prod
  (fn []
    (let [v1 (list 1 2 3)
          v2 (list 2 3 4)
          expected 20]
      (assert (= (dot-prod v1 v2) expected)))))

(def test-vmul
  (fn []
    (let [v1 (list 1 2 3)
          d 2
          expected (list 2 4 6)]
      (assert (= (vmul v1 d) expected)))))

(def test-vsub
  (fn []
    (let [v1 (list 4 3 2)
          v2 (list 3 2 1)
          expected (list 1 1 1)]
      (assert (= (vsub v1 v2) expected)))))


(def test-vadd
  (fn []
    (let [v1 (list 1 2 3)
          v2 (list 3 2 1)
          expected (list 4 4 4)]
      (assert (= (vadd v1 v2) expected)))))

; ===================================================

(test-dot-prod)
(test-vmul)
(test-vsub)
(test-vadd)